@tailwind base;
@tailwind components;
@tailwind utilities;

/* Import Google Fonts */
@import url('https://fonts.googleapis.com/css2?family=Playfair+Display:wght@400;500;600;700&family=Inter:wght@300;400;500;600&family=Merriweather:wght@300;400;700&family=JetBrains+Mono:wght@400;500&display=swap');

@layer base {
  :root {
    --radius: 0.75rem;
    
    /* Sidebar variables (keeping for compatibility) */
    --sidebar-background: 0 0% 98%;
    --sidebar-foreground: 240 5.3% 26.1%;
    --sidebar-primary: 240 5.9% 10%;
    --sidebar-primary-foreground: 0 0% 98%;
    --sidebar-accent: 240 4.8% 95.9%;
    --sidebar-accent-foreground: 240 5.9% 10%;
    --sidebar-border: 220 13% 91%;
    --sidebar-ring: 217.2 91.2% 59.8%;
  }
  
  .dark {
    --sidebar-background: 240 5.9% 10%;
    --sidebar-foreground: 240 4.8% 95.9%;
    --sidebar-primary: 224.3 76.3% 48%;
    --sidebar-primary-foreground: 0 0% 100%;
    --sidebar-accent: 240 3.7% 15.9%;
    --sidebar-accent-foreground: 240 4.8% 95.9%;
    --sidebar-border: 240 3.7% 15.9%;
    --sidebar-ring: 217.2 91.2% 59.8%;
  }
  
  /* Base styles */
  body {
    @apply bg-paper font-inter text-ink;
    background-image: 
      linear-gradient(rgba(245, 241, 228, 0.7), rgba(245, 241, 228, 0.7)),
      url('/textures/paper-texture.svg');
  }
  
  h1, h2, h3, h4, h5, h6 {
    @apply font-playfair;
  }
  
  strong, em, blockquote {
    @apply font-jetbrains;
  }
  
  code, pre {
    @apply font-jetbrains;
  }
  
  /* Scrollbar styling */
  ::-webkit-scrollbar {
    width: 8px;
    height: 8px;
  }
  

  
  ::-webkit-scrollbar-thumb {
    @apply bg-ink/30 rounded-full hover:bg-ink/50 transition-colors duration-300;
  }
}

@layer components {
  /* Paper-like elements */
  .paper-card {
    @apply bg-paper-light bg-opacity-90 backdrop-blur-sm border border-paper-dark/20 rounded-lg shadow-paper;
    position: relative;
    overflow: hidden;
  }
  
  .paper-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-image: url('/textures/paper-texture.svg');
    background-size: cover;
    opacity: 0.1;
    pointer-events: none;
  }
  
  /* Frosted glass effect */
  .glass {
    @apply bg-white/30 backdrop-blur-md border border-white/20 shadow-float;
    position: relative;
    overflow: hidden;
  }
  
  .glass::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.5), transparent);
    opacity: 0.5;
  }
  
  /* Ink effects */
  .ink-btn {
    @apply bg-ink-blue text-paper rounded-lg shadow-sm hover:shadow-md transition-all duration-300;
    position: relative;
    overflow: hidden;
  }
  
  .ink-btn::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 150%;
    height: 150%;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.2) 0%, transparent 70%);
    transform: translate(-50%, -50%) scale(0);
    opacity: 0;
    transition: transform 0.5s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.5s cubic-bezier(0.16, 1, 0.3, 1);
  }
  
  .ink-btn:hover::after {
    transform: translate(-50%, -50%) scale(1);
    opacity: 1;
  }
  
  .ink-btn-primary {
    @apply bg-ink-red text-paper rounded-lg shadow-sm hover:shadow-md transition-all duration-300;
    position: relative;
    overflow: hidden;
  }
  
  .ink-btn-primary::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 150%;
    height: 150%;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.2) 0%, transparent 70%);
    transform: translate(-50%, -50%) scale(0);
    opacity: 0;
    transition: transform 0.5s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.5s cubic-bezier(0.16, 1, 0.3, 1);
  }
  
  .ink-btn-primary:hover::after {
    transform: translate(-50%, -50%) scale(1);
    opacity: 1;
  }
  
  .ink-btn-secondary {
    @apply bg-ink-green text-paper rounded-lg shadow-sm hover:shadow-md transition-all duration-300;
    position: relative;
    overflow: hidden;
  }
  
  .ink-btn-secondary::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 150%;
    height: 150%;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.2) 0%, transparent 70%);
    transform: translate(-50%, -50%) scale(0);
    opacity: 0;
    transition: transform 0.5s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.5s cubic-bezier(0.16, 1, 0.3, 1);
  }
  
  .ink-btn-secondary:hover::after {
    transform: translate(-50%, -50%) scale(1);
    opacity: 1;
  }
  
  .ink-btn-gold {
    @apply bg-ink-gold text-ink rounded-lg shadow-sm hover:shadow-md transition-all duration-300;
    position: relative;
    overflow: hidden;
  }
  
  .ink-btn-gold::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 150%;
    height: 150%;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.3) 0%, transparent 70%);
    transform: translate(-50%, -50%) scale(0);
    opacity: 0;
    transition: transform 0.5s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.5s cubic-bezier(0.16, 1, 0.3, 1);
  }
  
  .ink-btn-gold:hover::after {
    transform: translate(-50%, -50%) scale(1);
    opacity: 1;
  }
  
  /* Floating ball */
  .floating-ball {
    @apply w-8 h-8 rounded-full bg-ink-blue shadow-md flex items-center justify-center text-paper;
    position: absolute;
    transform-origin: center;
    animation: paper-rise 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    z-index: 50;
  }
  
  .floating-ball::before {
    content: '';
    position: absolute;
    top: -2px;
    left: 50%;
    transform: translateX(-50%);
    width: 4px;
    height: 4px;
    border-radius: 50%;
    background-color: rgba(255, 255, 255, 0.7);
  }
  
  /* Text selection */
  ::selection {
    @apply bg-ink-blue/20 text-ink;
  }
  
  /* Animations */
  .ink-spread {
    @apply animate-ink-spread;
  }
  
  .float-in {
    @apply animate-float-in;
  }
  
  .paper-flip {
    @apply animate-paper-flip;
  }
  
  .ink-drop {
    @apply animate-ink-drop;
  }
  
  .ink-write {
    @apply animate-ink-write;
  }
  
  .paper-rise {
    @apply animate-paper-rise;
  }
  
  .cursor-blink {
    @apply animate-cursor-blink;
  }
  
  .stamp {
    @apply animate-stamp;
  }
  
  /* Markdown editor styles */
  .markdown-editor {
    @apply bg-transparent border-none outline-none w-full h-full font-inter text-ink;
  }
  
  .markdown-editor:focus {
    @apply outline-none ring-0;
  }
  
  /* Lined paper effect */
  .lined-paper {
    background-image: 
      linear-gradient(transparent 0px, transparent 23px, rgba(58, 50, 56, 0.07) 24px),
      linear-gradient(90deg, rgba(58, 50, 56, 0.05) 1px, transparent 1px);
    background-size: 100% 24px, 24px 100%;
    padding: 0;
    line-height: 24px;
  }
}

